# 合同上传接口层

import requests
import config


class ContractAPI:

    def __init__(self):
        self.url_upload = config.BASE_URL + "/api/common/upload"
        self.url_add = config.BASE_URL + "/api/contract"

    def upload_contract(self, token, test_data):
        return requests.post(url=self.url_upload, headers={"Authorization": token}, files={"file": test_data})

    def add_contract(self, test_data, token):
        return requests.post(url=self.url_add, json=test_data, headers={"Authorization": token})
